// 数据持久化

import { createStore, applyMiddleware } from 'redux'
import { persistStore, persistReducer } from 'redux-persist'
import storage from 'redux-persist/lib/storage'
import reducer from './reducer'

var persistedReducer = persistReducer({ key: 'redux', storage }, reducer)

var store = createStore(persistedReducer, applyMiddleware())

export var persistor = persistStore(store);

export default store




// import { createStore } from "redux";

// import reducer from './reducer'

// export default createStore(reducer)